modified lua 2013.05.24