beta 5

todo: fix input error, check for memory leaks