Fixed Errors Regarding Map Generation

Algo seems to be not functioning properly. Will issue a fix later on.