fixes issues #4 and #8

Still minor issues with emitting a signal but GUI part should mostly
work