Added support for structs

May be buggy when returning a struct