Added matrix input.