init codes

import from googlecode