update, lua best practice + some new functions