Cleand up code, still testing
Revert "Cleand up code, still testing"

This reverts commit ff07885e24b3ba2bea844804f7c8f9fe23cf25bf.