optimizing some code...mainly the take* and zip functions, better use of cond and handler-case