Adding ugly but almost functional version