main() fixed. Added pool use