refactored code a bit
updated license
re-ordered priority