First version that works somehow.