Had some problems with the typecasting