changed constructor parameters to arrays