Commit for night work 2013-08-06 and some messy codes