Revert "WORK IN PROGRESS"

This reverts commit 5d4e990c9d8ef8565d8a836dacf75189648df51e.
tabs->spaces and some debug stuff