Made Code Slightly More Pythonic

Also, fixed map bug.