add resource managment, changed to double position drawing