cleaner code, better comments