few memory leaks
start again working on selection part!