first commit. not fully functional yet, needs to be tuned a bit