finished making it more object orientated