Bug fix

Fixed a bug on looping and increased performance