fix bug. port to ts
write shebang
move files. port to ts. fix bugs
devide files
remove console.log s