Fixed bad reference
Tweaked variable handling and added 'first' method