using arrays instead of lists whereever possible