fix code to use INT on ALL arguments
wtf direction is not integer!
DAMN TYPO
Adding logger