Merged maps code with Rahul's file