copyright (c) 2007 michal pelc