added view layer, rewrote some methods