Worked out some backend code (Untested)

Started some backend code, haven't tested it yet but it should work once
i get the libs to work