improved the casting and get functions, worked on the tests