Fixed some bad code, and reversed printmap function