added vertical/horizontal alignments, fixed tests