made the api work with doubles