some codes were arranged to my coding style