Initial commit of tested and functional version