tested and cleaned up