Finished version of petimebak , (have bugs)