Added a debug copy with less comments and a more cleaner looking code for easier debugging puroposes