Converted to use vectors instead of lists