Code cleanup - all bugs hopefull fixed; things should go a bit faster