added some features, and fixed the luach