updating to work with phpstorm, although there are problems such as
the element locking looks flaky (I put try/catch on main method to allow
it to be used without showing errors in these situations)