few basic functions decompiled and small bug fix