!!!NOT STABLE Start of cleaning up code
WARNING: Not stable!