use from_to instead of custom functions
minor fix