fixed deviceptr issues and added support for more helper functions