lot of bug corrections and GUI improvements