Compatibility tested (changed a bit of syntax), gui separated from main