WIP: fix existing routines
WIP: fix implementation of basic routines