comments and useless code removed