Fixed mapping functions and added libraries