Initial functional commit. Works on a basic level