update

update includes
- cleaning up repetitive function
- comments
- little cleaner