added isAdmin check closes #9
lots of code cleanup