fixed bugs and update simple example