Added memory handlers, plus code to set cursor shape - uncompiled