compacted code, added menubar script