Changed # to index from 0

Also updated to work with cabin