Guard

guard class and minor bug fixes