Fixed gaps costs in position 0 along top and side; renamed variables