organizing the messy code

Sometimes I can't also remind wth I've done