add resolve() and reject() methods
add args to reject() and resolve() methods
fix some minor bugs
refactor code