make better coding and fix bugs