Port low level

Most important functions added & working
what is it doing? unclear name.